<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends CommonAction {
	public function __construct(){
		parent::__construct();
		$this->assign('loginname',$_SESSION['USER_ADMIN_KEY']);
	}

    public function index(){
        $user=M("User")->field("sum(rmb) as rmb , sum(rmb_frozen) as rmb_frozen,sum(xnb) as xnb,sum(xnb_frozen) as xnb_frozen,count(*) as num")->find();
       $this->assign("user",$user);
       
       $buy_stauts_all=M("Buy")->sum("num");//数量
       $this->assign("buy_status_all",$buy_stauts_all);
       $buy_status_two=M("Buy")->where("status = 2")->sum("num");//数量
        $this->assign("buy_status_two",$buy_status_two);       

        
        $fill_num=M("Fill")->sum("num");//充值表
        $this->assign("fill_num",$fill_num);
        $draw_num=M("Draw")->sum("num");//提现表
        $this->assign("draw_num",$draw_num);
	    $this->display('./Tpl/Admin/welcome.html');
    }

	public function top(){
	    $this->display('./Tpl/Admin/Top.html');
    }

	public function left(){
	    $this->display('./Tpl/Admin/Left.html');
    }

	public function home(){
	    $this->display('./Tpl/Admin/Home.html');
    }
}
?>